#include <iomanip>
#include <iostream>

using namespace std;

inline double factorial(const int n) {
  int v{1};
  if (n != 0) {
    for (int i = 1; i <= n; ++i)
      v *= i;
  }
  return v;
}

int main() {

  for (int i = 0; i < 4; ++i) {
    cout << factorial(i) << "  ";
  }
  return 0;
}